﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLNHDAO;

namespace QLNHBUS
{
    public class BanAnBUS
    {
        public  static  BanAn LayBanAnTheoMaBanAn(int id)
        {
            BanAnDAO ban = new BanAnDAO();
            return ban.GetElementByID(id);
        }
        public static List<BanAn> LayDanhSachBanAn(int i)
        {
            BanAnDAO ban = new BanAnDAO();
            return ban.SearchFor(c => c.KhuVuc.MaKhuVuc == i&&c.Xoa==false).ToList();
        }
        public  static void ThemBanAn(BanAn ba)
        {
            BanAnDAO ban = new BanAnDAO();
            ban.Add(ba);
        }
        public static void XoaCapNhapBanAn(BanAn ba)
        {
            BanAnDAO ban = new BanAnDAO();
            ban.Update(ba);
        }
    }
}
